package com.wyl.services

import com.wyl.dao.BookMapper
import com.wyl.pojo.Books
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service


@Service
class BookServiceImpl : BookService {
    @Autowired
    lateinit var bookMapper: BookMapper

    override fun addBook(books: Books): Int {
        return bookMapper.addBook(books)
    }

    override fun deleteBookByID(id: Int): Int {
        return bookMapper.deleteBookByID(id)
    }

    override fun updateBook(books: Books): Int {
        return bookMapper.updateBook(books)
    }

    override fun queryBookByID(id: Int): Books {
        return bookMapper.queryBookByID(id)
    }

    override fun queryAll(): List<Books> {
        return bookMapper.queryAll()
    }
}